home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / pascal / wndw40.zip / WNDWDEMO.PAS < prev    next >
Pascal/Delphi Source File  |  1987-12-11  |  23KB  |  679 lines

  1. { =========================================================================== }
  2. { WndwDemo.pas - Multi-level window demo for WNDW40.TPU     ver 4.0, 12-12-87 }
  3. {                                                                             }
  4. { This program shows you some of basic window utilities.  It only shows       }
  5. { access any window at any time.  You can even hide the top level window for  }
  6. { displaying later.                                                           }
  7. { =========================================================================== }
  8.  
  9. program WindowDemo;
  10.  
  11. {$M 16384, 22000, 22000 }
  12. {$R-,S-,I+,D-,T-,F-,V-,B-,N-,L+ }
  13.  
  14. uses Crt,Qwik,WndwVars,Wndw;
  15.  
  16. type
  17.   Str80 = string[80];
  18.   Steps = (Step0,Step1,Step2,Step3,Step3b,Step3c,Step4,Step5,Step5b,Step6,
  19.            Step7,Step8,Step9,Step9b,Step9c,Step11,Step12,Step13,Step14,
  20.            Step15,Step16,Step17);
  21.  
  22. var
  23.   Step:              Steps;
  24.   i,j,k,m,OldCursor: word;
  25.   Battr,Wattr:       integer;
  26.   Key:               char;
  27.  
  28. const
  29.   FuncKey = #00;
  30.   RetKey = #13;
  31.   EscKey = #27;
  32.   StrA : array [1..17] of Str80 = (
  33.     'The  windowing  utilities in the  file  WNDW40.ARC',
  34.     'combined  with QWIK40.ARC are  ShareWare  routines',
  35.     'that  allow Turbo Pascal 4.0 to create  incredibly',
  36.     'fast  multi-level random-access windows.   Here is',
  37.     'the kind of windows you can create:',
  38.     '',
  39.     '  Size:        2x2 to screen limits',
  40.     '  Colors:      256 for window and/or border',
  41.     '  Borders:     12 styles, 2 custom, or no border',
  42.     '  Partitions:  Horizontal, vertical and cross',
  43.     '  Column mode: 40/80/variable',
  44.     '  Text modes:  All (0..3, 7)',
  45.     '',
  46.     'These windows  can be accessed at any level, shuf-',
  47.     'fled around, or even moved by the end user.  These',
  48.     'utilities automatically  configure  to  your video',
  49.     'card(s) and mode for the greatest speed.');
  50.  
  51.   StrB : array [1..11] of Str80 = (
  52.     'WNW40.ARC consists of fourteen utilities:',
  53.     '',
  54.     '      InitWindow       TitleWindow',
  55.     '      SetWindowModes   ClearTitle',
  56.     '      MakeWindow       ClearWindow',
  57.     '      PartitionWindow  HideWindow',
  58.     '      PartitionCross   ShowWindow',
  59.     '      ScrollWindow     MoveWindow',
  60.     '      RemoveWindow     AccessWindow',
  61.     '',
  62.     'and are described in the following windows:');
  63.  
  64.   StrC : array [1..6] of Str80 = (
  65.     'FORMAT:  InitWindow (WindowAttr: byte, ClearScr: boolean);',
  66.     '',
  67.     'InitWindow initializes 24 variables needed by the utilities.',
  68.     'You can select  the foreground and  background colors of the',
  69.     'initial screen display with the option  to clear the screen.',
  70.     'InitWindow must be called before using any other procedures.');
  71.  
  72.   StrC1 : array [1..12] of Str80 = (
  73.     'FORMAT:  SetWindowModes (SumOfAllModes: byte);',
  74.     '',
  75.     'SetWindowModes is any easy way to set the following window mode',
  76.     'constants saved in the global variable WindowModes:',
  77.     '',
  78.     '  PermMode    = $01 - Can''t be moved or removed; no underlay',
  79.     '  FixedMode   = $02 - Can''t be moved or accessed',
  80.     '  ShadowLeft  = $04 - Shadow on the left side',
  81.     '  ShadowRight = $08 - Shadow on the right side',
  82.     '  ZoomMode    = $10 - Zoom effect on Make and AccessWindow',
  83.     '',
  84.     'WindowModes is maintained for subsequent windows until changed.');
  85.  
  86.   StrC2: array [1..9] of Str80 = (
  87.     'CGA:',
  88.     'The CGA is self-regulating and controls the',
  89.     'zoom rate.',
  90.     'MDA, EGA, MCGA, VGA, Hercules, and others:',
  91.     'These video cards are  quite fast and need a',
  92.     'delay for the effect.  A default value of 12',
  93.     'or 18 milliseconds  is  used in "ZoomDelay",',
  94.     'the  latter is  used on  faster 80286/80386',
  95.     'machines.');
  96.  
  97.   StrD1 : array [1..16] of Str80 = (
  98.     'FORMAT:  MakeWindow (Row,Col,Rows,Cols: byte; Wattr,Battr: integer;',
  99.     '                     BrdrSel: Borders; WindowName: WindowNames);',
  100.     '',
  101.     'MakeWindow  creates a new blank  window  starting at  (row,col)  and',
  102.     'extending for a number of rows and columns (rows,cols).  If a border',
  103.     'exists, the Turbo window will  be shrunk within the borders.  A name',
  104.     'serves as an ID for random access.  The border can be any one of the',
  105.     'following:',
  106.     '',
  107.     '  NoBrdr      - just window     EvenSolidBrdr  - evenly solid',
  108.     '  BlankBrdr   - blank spaces    ThinSolidBrdr1 - thin solid line',
  109.     '  SingleBrdr  - single line     ThinSolidBrdr2 - thin solid line',
  110.     '  DoubleBrdr  - double line     LhatchBrdr  - light hatch',
  111.     '  HdoubleBrdr - horiz double    MhatchBrdr  - medium hatch',
  112.     '  VdoubleBrdr - vert double     HhatchBrdr  - heavy hatch',
  113.     '  SolidBrdr   - solid           UserBrdr1/2 - user defined borders');
  114.  
  115.   StrD2 : array [1..6] of Str80 = (
  116.     'FORMAT:  PartitionWindow (Direction: DirType; RowOrCol: byte);',
  117.     '         PartitionCross  (WindowRow,WindowCol: byte);',
  118.     'Partitions can be made inside any window with a border as shown.',
  119.     'Simply specify the direction (Horiz/Vertical) and the location',
  120.     'relative to the Turbo window.  A PartitionCross is needed where',
  121.     'both the vertcial and horizontal intersect.');
  122.  
  123.   StrE : array [1..4] of Str80 = (
  124.     'FORMAT:   RemoveWindow;',
  125.     'RemoveWindow removes the top level',
  126.     'window  from  the screen  and also',
  127.     'from memory.');
  128.  
  129.   StrF : array [1..2] of Str80 = (
  130.     'See if your BIOS gives you flicker',
  131.     'when your screen rolls down next ...');
  132.  
  133.   StrG : array [1..16] of Str80 = (
  134.     '',
  135.     'FORMAT:  ScrollWindow (RowBegin,RowEnd: byte; Dir: DirType);',
  136.     '',
  137.     'Turbo''s standard procedures  InsLine and DelLine may have worked just',
  138.     'fine this window.  However, if  your screen just had some bad flicker',
  139.     'as it was scrolling down, your  BIOS is not flicker-free. To keep the',
  140.     'display flicker-free, to work on other video pages, VGA, or EGA, then',
  141.     'you will need this procedure.   The upward  scroll used ScrollWindow,',
  142.     'so no flicker was seen then.  It also scrolls partial windows.',
  143.     '',
  144.     'The direction of scroll can be either of the following:',
  145.     '',
  146.     '    ''Up''   - to scroll up',
  147.     '    ''Down'' - to scroll down',
  148.     '',
  149.     '');
  150.  
  151.   StrH : array [1..5] of Str80 = (
  152.     'FORMAT:  TitleWindow (TopOrBottom,Justify: DirType;',
  153.     '                      Title: string);',
  154.     'TitleWindow  places  a title  in  the top  or bottom',
  155.     'border of the current window.  Justify permits Left,',
  156.     'Center, or Right justification of the title.');
  157.  
  158.   StrH2 : array [1..3] of Str80 = (
  159.     'FORMAT:  ClearTitle (TopOrBottom: DirType);',
  160.     'ClearTitle clears  the entire top or bottom',
  161.     'border of a title by restoring the border.');
  162.  
  163.   StrH3 : array [1..4] of Str80 = (
  164.     'FORMAT:  ClearWindow;',
  165.     'ClearWindow works just',
  166.     'like ClrScr,  but also',
  167.     'on any video page.');
  168.  
  169.   StrJ : array [1..5] of Str80 = (
  170.     'The maximum  number  of windows that',
  171.     'may be on the screen at any one time',
  172.     'is   specified   by   the   constant',
  173.     '"MaxWndw".   Assign  it in  the unit',
  174.     'called WNDWVARS.PAS.');
  175.  
  176.   StrK : array [1..10] of Str80 = (
  177.     'In addition to windows, there are 17 powerful',
  178.     'QWIK screen write procedures you can use:',
  179.     '    Qwrite    QfillC        GotoRC',
  180.     '    QwriteC   Qfill         CursorChange',
  181.     '    QwriteA   QstoreToMem   CursorOn',
  182.     '    Qattr     QstoreToScr   CursorOff',
  183.     '    QattrC    QviewPage     WhereR',
  184.     '              QwritePage    WhereC',
  185.     'In QWIK40.ARC, compile and run QWIKDEMO.PAS to',
  186.     ' see all of the features.');
  187.  
  188.   StrL : array [1..20] of Str80 = (
  189.     'The procedures are used as follows:',
  190.     '',
  191.     ' program YourProgram;',
  192.     ' uses Qwik,Crt,WndwVars,Wndw;',
  193.     ' ...Your variables and procedures...',
  194.     ' begin',
  195.     '   InitWindow (WindowAttr,ClearScr);',
  196.     '   SetWindowModes (SumOfAllModes);',
  197.     '   MakeWindow (Row,Col,Rows,Cols,Wattr,Battr,',
  198.     '               BrdrSelection,WindowName);',
  199.     '   Pa